<template>
  <div class="manager">
    <!-- 用于接受管理页面，首页，订单页，我的页面 -->
    <router-view></router-view>
    <!-- 底部导航栏 -->
    <van-tabbar
      v-model="active"
      @change="change()"
      active-color="#ee0a24"
      inactive-color="#000"
    >
      <van-tabbar-item icon="home-o" to="/manager/home">主页</van-tabbar-item>
      <van-tabbar-item icon="search" to="/manager/order">订单</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="/manager/help"
        >帮助</van-tabbar-item
      >
      <van-tabbar-item icon="setting-o" to="/manager/mine"
        >我的</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  data() {
    return {
      active: 0,
    };
  },
  methods: {
    change() {
      if (this.$route.query.navPage) {
        this.active = parseInt(this.$route.query.navPage) ;
      }
    },
  },

  created() {
    this.change()
  },
};
</script>

<style scoped>
</style>